//
//  NSString+RealPhoneNumber.m
//  OneToOne
//
//  Created by Herui on 15/1/26.
//  Copyright (c) 2015年 jiayuan. All rights reserved.
//

#import "NSString+RealPhoneNumber.h"

@implementation NSString (RealPhoneNumber)

+ (NSString *)getRealNumber:(NSString *)number
{
    
    NSRange range = [number rangeOfString:@"(24h)"];
    NSString *newString;
    if (range.location != NSNotFound) {
        newString = [number stringByReplacingCharactersInRange:range withString:@""];
    } else {
        newString = number;
    }
    
    newString = [newString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
    
    if ([number rangeOfString:@"-"].location != NSNotFound) {
        newString = [newString stringByTrimmingCharactersInSet:[NSCharacterSet symbolCharacterSet]];
    }
    
    return newString;
}

@end
